package com.androidified.personalshopper;

import java.io.Serializable;

import com.littlefluffytoys.littlefluffylocationlibrary.LocationInfo;
import com.littlefluffytoys.littlefluffylocationlibrary.LocationLibraryConstants;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class LocationUpdatesReceiver extends BroadcastReceiver {

	@Override
	public void onReceive(Context arg0, Intent intent) {
		if (BuildConfig.DEBUG) Log.d(Constants.LOG_TAG, "onReceive");
		Serializable s = intent.getSerializableExtra(LocationLibraryConstants.LOCATION_BROADCAST_EXTRA_LOCATIONINFO);
		if (s != null && s instanceof LocationInfo) {
			LocationInfo info = (LocationInfo) s;
			BusProvider.get().post(info);
		}
	}

}
